package com.surveillance.tests;

import java.util.ArrayList;
import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.surveillance.BO.BOLayer;
import com.surveillance.BO.ExamenBO;
import com.surveillance.BO.MatiereBO;
import com.surveillance.entities.Etudiant;
import com.surveillance.entities.Examen;
import com.surveillance.entities.Matiere;
import com.surveillance.entities.Salle;
import com.surveillance.util.LoadBeans;

public class PopulatingExamen {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		 ExamenBO examenBo = (ExamenBO) LoadBeans.getExamenBO(); MatiereBO
		 matiereBo = (MatiereBO)LoadBeans.getMatiereBO(); // instaciating math1 object 
		 /*Matiere math1 = new Matiere();
		 math1.setIntitule("Math1"); matiereBo.save(math1); //instaciating examen object*/
		 
		 /*Examen examen1 = new Examen(); 
		 examen1.setMatiere(matiereBo.findByID(new Long(1)));
		 examen1.setNiveau(1); 
		 examen1.setSpecialite(true);
		 examenBo.save(examen1);
		 
		ArrayList<Examen> examens = (ArrayList<Examen>) ((ExamenBO) LoadBeans
				.getExamenBO()).getExamensByNiveauSpec(1, true);
		System.out.println("examens ==>>"+examens.get(1));*/
		 ArrayList<Examen> examens = (ArrayList<Examen>) ((ExamenBO) LoadBeans
					.getExamenBO()).getDatesDesExamen(new Date(), new Date());
			System.out.println("examens ==>>"+examens.get(0));
			
			/*ArrayList<Examen> examens = (ArrayList<Examen>) ((ExamenBO) LoadBeans
					.getExamenBO()).getExamensByNiveauSpec(1, false);
			System.out.println("examens ==>>"+examens.get(0));*/
		// examenBo.delete(examenBo.findByID(new Long(1)));
		 
	}
}
